<?php
class Admincp_model extends Admin_Model {

	function checkLogin($user){
		$this->db->select('*');
		$this->db->where('username', $user);
		$this->db->where($this->status_name, 1);
		$query = $this->db->get(ADMIN_USER_TABLE);
		
		foreach ($query->result() as $row){
			$pass = $row->password;
		}
		
		if(!empty($pass)){
			return $pass;
		}else{
			return false;
		}
	}
	
	function getInfo($user){
		$this->db->select('*');
		$this->db->where('username', $user);
		$this->db->where($this->status_name, 1);
		$query = $this->db->get(ADMIN_USER_TABLE);

		if($query->result()){
			return $query->result();
		}else{
			return false;
		}
	}
}